﻿
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
using lib.Model;
using lib.DAL;
namespace lib.BLL
{
    public partial class RoleMenuManage_Bll
    {
        /// <summary>
        /// 检测用户是否有权限
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <param name="menuId">菜单ID</param>
        /// <param name="roleCode">角色权限Code</param>
        /// <returns></returns>
        public bool CheckMenuRole(int roleId, int menuId, int roleCode)
        {
            bool result = false;
            string where = "fdRoleManageID=@fdRoleManageID and fdRoleMenuID=@fdRoleMenuID and fdRoleMenuRoleCode=@fdRoleMenuRoleCode";
            List<SqlParameter> parmList = new List<SqlParameter>();
            parmList.Add(new SqlParameter("@fdRoleManageID", roleId));
            parmList.Add(new SqlParameter("@fdRoleMenuID", menuId));
            parmList.Add(new SqlParameter("@fdRoleMenuRoleCode", roleCode));
            RoleMenuManage_Model roleMenuManagerModel = dal.GetModel(where, parmList.ToArray());
            if (roleMenuManagerModel != null) result = true;
            return result;
        }
    }
}

